﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using Sparkle.Lib;
using Sparkle.Lib.Attributes;
using Sparkle.Hosting;

namespace Sparkle.Demo.Model
{

    public enum JobType
    {
        NotSet=0,
        Permanent=1,
        Temp,
        Contract,
        PartTime
    }

    public class Employee : Person, IModel
    {
        [DisplayAttribute(Name = "Employee No.", GroupName = "Employeement", Order=1 )]
        [Visualization(ReadOnly=true)]
        [Required()]
        public string EmpId { get; set; }

        [DisplayAttribute(Name = "Date Of Join", GroupName = "Employeement", Order = 2)]
        [Required()]
        public Date DOJ { get; set; }

        private JobType _jobType = JobType.NotSet;

        [DisplayAttribute(Name = "Job Type", GroupName = "Employeement", Order = 3)]
        [ValueNotEqual(JobType.NotSet)]
        public JobType JobType 
        {
            get { return _jobType; }
            set { _jobType = value; } 
        }

        [DisplayAttribute(Name="Salary(Per year)",GroupName="Payment", Order=1)]
        [Required()]
        public double Salary { get; set; }


        #region IModel Members

        public bool Validate()
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
